﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页-登录</title>
    <style>
        body{overflow:scroll; background-color: rgba(220, 220, 220,0.5);}
        div{background-color: rgba(190, 140, 90,0.4);width:1400px;height:76px;}

        a{font-size:140%;float:right;}
        a:link{color: #111111;text-decoration:none;}	/* 未访问的链接 */
        a:visited {color: #eeeeee;text-decoration:none;}
        a:hover {color: rgba(200 ,76 ,108,0.4);text-decoration:none;}	/* 鼠标移动到链接上 */
        a:active {color:rgb(160,130,120);text-decoration:none;}	/* 选定的链接 */
        </style>
    <script type="text/javascript" src="http://code.jquery.com/jquery-2.0.0.js"></script>

<script>


	function tz() {
		var username = $('#username').val(),
			password = $('#password').val();
		
		if (!username) {
			alert('用户名不能为空！');
			return false;
		}
		if (!password) {
			alert('密码不能为空！');
			return false;
		}
		$.ajax({
			type : "GET",
			url : "/api?fid=login&username="+username+"&password="+password,
			dataType : 'json',
			success : function(data) {
				if(data.code==1){
					location.href='/首页1.html';
				} else {
					alert(data.desc);
				}
			},
			error : function(data) {
				alert("登录错误！");
			}
		});
	}
</script>
</head>
<body>
<div><h1 style="position:relative;top:10px;left:15px;">学习任务智能规划系统</h1>
    <div class="c"><b><a href="/更多模块.html">更多模块&nbsp;</a>
        <a href="/错题集.html">错题集&nbsp;</a>
        <a href="/首页1.html">首页&nbsp;</a>
    </b></div>
</div>
<div class="block-container" style="padding:0;">
    <div id="banner">
        <div class="container">
            <div class="index-banner swiper-container">
                <div class="swiper-wrapper">

                </div>
            </div>
        </div>
    </div>
</div>



<div style=" position:absolute;top:50%;left:38%;width:400px;height:200px;border-radius: 10px;text-align: center;">
<br>欢迎登录 
    <p><input type="text" id="username" placeholder="请输入账号"/></p>
    <br><input type="password" id="password" placeholder="请输入密码"/>
    <br><br><input type="submit" value="提交" onclick="tz()" />
</div>

</body>
</html>